package com.example.sls.controller.social;

import com.example.sls.pojo.social.TGroups;
import com.example.sls.service.intserfaces.social.TGroupsService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 群组表(TGroups)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:44
 */
@RestController
@RequestMapping("social/tGroups")
public class TGroupsController {
  @Autowired
  TGroupsService tGroupsService;

  @GetMapping("queryById")
  TGroups queryById(Integer id) {
    return tGroupsService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<TGroups> queryAllByLimit(TGroups tGroups, Integer pageSize, Integer offset) {
    return tGroupsService.queryAllByLimit(tGroups, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return tGroupsService.count();
  }

  @GetMapping("insert")
  int insert(TGroups tGroups) {
    return tGroupsService.insert(tGroups);
  }

  @GetMapping("update")
  int update(TGroups tGroups) {
    return tGroupsService.update(tGroups);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return tGroupsService.deleteById(id);
  }
}

